const location = {

  getLocation() {
    return new Promise((resolve, reject) => {
      wx.getLocation({
        type: '',
        success: function (res) { resolve(res) },
        fail: function (res) { reject(res) },
        complete: function (res) { },
      })
    })
  },

  chooseLocation() {
    return new Promise((resolve, reject) => {
      wx.chooseLocation({
        success: function (res) { resolve(res) },
        fail: function (res) { reject(res) },
        complete: function (res) { },
      })
    })
  }
}